[MC-EDMX]:
Entity Data Model for Data Services Packaging Format
Intellectual Property Rights Notice for Open Specifications Documentation
§ Technical Documentation. Microsoft publishes Open Specifications documentation for protocols, file formats, languages, standards as well as overviews of the interaction among each of these technologies.
§ Copyrights. This documentation is covered by Microsoft copyrights. Regardless of any other terms that are contained in the terms of use for the Microsoft website that hosts this documentation, you may make copies of it in order to develop implementations of the technologies described in the Open Specifications and may distribute portions of it in your implementations using these technologies or your documentation as necessary to properly document the implementation. You may also distribute in your implementation, with or without modification, any schema, IDL’s, or code samples that are included in the documentation. This permission also applies to any documents that are referenced in the Open Specifications.
§ No Trade Secrets. Microsoft does not claim any trade secret rights in this documentation.
§ Patents. Microsoft has patents that may cover your implementations of the technologies described in the Open Specifications. Neither this notice nor Microsoft's delivery of the documentation grants any licenses under those or any other Microsoft patents. However, a given Open Specification may be covered by Microsoft's Open Specification Promise (available here: http://www.microsoft.com/interop/osp) or the Community Promise (available here: http://www.microsoft.com/interop/cp/default.mspx). If you would prefer a written license, or if the technologies described in the Open Specifications are not covered by the Open Specifications Promise or Community Promise, as applicable, patent licenses are available by contacting iplg@microsoft.com.
§ Trademarks. The names of companies and products contained in this documentation may be covered by trademarks or similar intellectual property rights. This notice does not grant any licenses under those rights.
§ Fictitious Names. The example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted in this documentation are fictitious. No association with any real company, organization, product, domain name, email address, logo, person, place, or event is intended or should be inferred.
Reservation of Rights. All other rights are reserved, and this notice does not grant any rights other than specifically described above, whether by implication, estoppel, or otherwise.
Tools. The Open Specifications do not require the use of Microsoft programming tools or programming environments in order for you to develop an implementation. If you have access to Microsoft programming tools and environments you are free to take advantage of them. Certain Open Specifications are intended for use in conjunction with publicly available standard specifications and network programming art, and assumes that the reader either is familiar with the aforementioned material or has immediate access to it.
Revision Summary
| Date | Revision History | Revision Class | Comments |
| 02/27/2009 | 0.1 | Major | First Release. |
| 04/10/2009 | 0.1.1 | Editorial | First Release. |
| 05/22/2009 | 0.1.2 | Editorial | Revised and edited the technical content. |
| 07/02/2009 | 0.1.3 | Editorial | Revised and edited the technical content. |
| 08/14/2009 | 0.1.4 | Editorial | Revised and edited the technical content. |
| 09/25/2009 | 0.2 | Minor | Updated the technical content. |
| 11/06/2009 | 0.2.1 | Editorial | Revised and edited the technical content. |
| 12/18/2009 | 0.2.2 | Editorial | Revised and edited the technical content. |
Contents
1.3 Structure Overview (Synopsis)
1.4 Relationship to Protocols and Other Structures
1.6 Versioning and Localization
This document specifies the Entity Data Model for Data Services Packaging Format (EDMX), an XML-based file format that serves as the packaging format for the service metadata of a Data Service.
Data Services are specified in [MC-APDSU]. The Entity Data Model and the Entity Data Model Conceptual Schemas are specified in [MC-CSDL].
The following terms are defined in [MC-CSDL]:
CSDL
Entity Data Model (EDM)
Schema
The following terms are defined in [MC-APDSU]:
Data Service
The following terms are specific to this document:
<edmx:Edmx>: Every EDMX document MUST have a single <edmx:Edmx> element. When used to package the service metadata for a Data Service the <edmx:Edmx> element MUST contain exactly one <edmx:DataServices> element. The <edmx:Edmx> element is fully specified in section 2.1 of this document.
<edmx:DataServices>: The <edmx:DataServices> element MAY contain zero or more Entity Data Model Conceptual Schema (as specified in [MC-CSDL]), which are annotated as described in [MC-APDSU]. The <edmx:DataServices> element is fully specified in section 2.2 of this document.
MAY, SHOULD, MUST, SHOULD NOT, MUST NOT: These terms (in all caps) are used as specified in [RFC2119]. All statements of optional behavior use either MAY, SHOULD, or SHOULD NOT.
We conduct frequent surveys of the normative references to assure their continued availability. If you have any issue with finding a normative reference, please contact dochelp@microsoft.com. We will assist you in finding the relevant information. Please check the archive site, http://msdn2.microsoft.com/en-us/library/E4BD6494-06AD-4aed-9823-445E921C9624, as an additional source.
[MC-APDSU] Microsoft Corporation, "Atom Publishing Protocol: Data Services URI and Payload Extensions", February 2009.
[MC-CSDL] Microsoft Corporation, "Conceptual Schema Definition File Format", February 2009.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997, http://www.ietf.org/rfc/rfc2119.txt
[XMLSCHEMA1] Thompson, H.S., Ed., Beech, D., Ed., Maloney, M., Ed., and Mendelsohn, N., Ed., "XML Schema Part 1: Structures", W3C Recommendation, May 2001, http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/
None.
None.
1.3 Structure Overview (Synopsis)
An Entity Data Model for Data Services Packaging Format (EDMX) document is an XML-based file format that serves as the packaging format for the service metadata of a Data Service.
As specified in [MC-APDSU], clients can obtain the service metadata for a Data Service with a URI of the following signature.
http://<host>/<prefix>/<service path>/$metadata
The Data Service returns service metadata packaged in an EDMX document. The root of an EDMX document is an <edmx:Edmx> element, which contains exactly one <edmx:DataServices> subelement. The <edmx:DataServices> subelement contains zero or more <Schema> subelements, which specify Entity Data Model Conceptual Schemas. These Entity Data Model Conceptual Schemas are annotated as specified in [MC-APDSU].
Conceptually, the structure of an EDMX document resembles the following.
<edmx:Edmx>
<edmx:DataServices>
<!-- Entity Data Model Conceptual Schemas, as specified in
[MC-CSDL] and annotated as specified in [MC-APDSU] -->
<Schema>
</Schema>
<!--
Additional Entity Data Model Conceptual Schemas as
specified in [MC-CSDL] and annotated as specified in [MC-APDSU]
-->
</edmx:DataServices>
</edmx:Edmx>
The contents of an EDMX document are completely determined by the Data Service in question and will vary depending on the Data Service, as specified in [MC-APDSU].
1.4 Relationship to Protocols and Other Structures
EDMX serves as the packaging format of the metadata of a Data Service (as specified in [MC-APDSU]).
An EDMX document is used when clients of a Data Service (as specified in [MC-APDSU]) require the Data Service's metadata.
1.6 Versioning and Localization
This document specifies version 1.0 of EDMX.
An EDMX document does not contain any vendor extensible fields, nor does it support extensibility. However, Entity Data Model Conceptual Schemas packaged in an EDMX document support an extension mechanism through the use of Annotations (AnnotationAttribute and AnnotationElement), as specified in [MC-CSDL].
Parsers of EDMX documents ignore content which they do not expect or do not understand.
The <edmx:Edmx> element defines the XML namespace for the EDMX document and contains the <edmx:DataServices> sub-element.
Example
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
The following rules apply to the <edmx:Edmx> element.
§ An EDMX document MUST have exactly one <edmx:Edmx> element as its root element.
§ The Version attribute MUST be defined on the <edmx:Edmx> element. Version is of type <xs:string>, as specified in the XML Schema [XMLSCHEMA1].
§ The <edmx:Edmx> element MUST contain exactly one <edmx:DataServices> sub-element.

Figure 1: Format of an <edmx:Edmx> element
The <edmx:DataServices> element contains the service metadata of a Data Service. This service metadata contains zero or more Entity Data Model Conceptual Schemas (as specified in [MC-CSDL]), which are annotated as specified in [MC-APDSU].
Example:
<edmx:DataServices>
The following rules apply to the <edmx:DataServices> element:
§ The <edmx:Edmx> element MUST have exactly one <edmx:DataServices> sub-element.
§ The <edmx:DataServices> element may contain zero or more Schema sub-elements.

Figure 2: Format of a <edmx:DataServices> element
The following is an example the service metadata returned by a Data Service. The <edmx:Edmx> and <edmx:DataServices> elements are specified in sections 2.1 and 2.2 of this document; all other XML elements are specified in [MC-CSDL] and [MC-APDSU].
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
<edmx:DataServices>
<Schema Namespace="NorthwindModel"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"
xmlns="http://schemas.microsoft.com/ado/2006/04/edm">
<EntityContainer Name="NorthwindEntities" m:IsDefaultEntityContainer="true">
<EntitySet Name="OrderDetails" EntityType="NorthwindModel.OrderDetail" />
<EntitySet Name="Orders" EntityType="NorthwindModel.Order" />
<AssociationSet Name="OrderDetails_Orders" Association="NorthwindModel.OrderDetails_Orders">
<End Role="Orders" EntitySet="Orders" />
<End Role="OrderDetails" EntitySet="OrderDetails" />
</AssociationSet>
</EntityContainer>
<EntityType Name="OrderDetail">
<Key>
<PropertyRef Name="OrderID" />
<PropertyRef Name="ProductID" />
</Key>
<Property Name="Discount" Type="Edm.Single" Nullable="false" />
<Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
<Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
<Property Name="Quantity" Type="Edm.Int16" Nullable="false" />
<Property Name="UnitPrice" Type="Edm.Decimal" Nullable="false" Precision="19" Scale="4" />
<NavigationProperty Name="Order" Relationship="NorthwindModel.OrderDetails_Orders" FromRole="OrderDetails" ToRole="Orders" />
</EntityType>
<EntityType Name="Order">
<Key>
<PropertyRef Name="OrderID" />
</Key>
<Property Name="CustomerID" Type="Edm.String" Nullable="true" MaxLength="5" Unicode="true" FixedLength="true" />
<Property Name="OrderDate" Type="Edm.DateTime" Nullable="true" />
<Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
<Property Name="ShipAddress" Type="Edm.String" Nullable="true" MaxLength="60" Unicode="true" FixedLength="false" />
<NavigationProperty Name="OrderDetails" Relationship="NorthwindModel.OrderDetails_Orders" FromRole="Orders" ToRole="OrderDetails" />
</EntityType>
<Association Name="OrderDetails_Orders">
<End Role="Orders" Type="NorthwindModel.Order" Multiplicity="1" />
<End Role="OrderDetails" Type="NorthwindModel.OrderDetail" Multiplicity="*" />
<ReferentialConstraint>
<Principal Role="Orders">
<PropertyRef Name="OrderID" />
</Principal>
<Dependent Role="OrderDetails">
<PropertyRef Name="OrderID" />
</Dependent>
</ReferentialConstraint>
</Association>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
None.
5 Appendix A: Product Behavior
The information in this specification is applicable to the following Microsoft products:
§ Microsoft® .Net Framework Version 3.5 Service Pack 1 (SP1)
Exceptions, if any, are noted below. If a service pack number appears with the product version, behavior changed in that service pack. The new behavior also applies to subsequent service packs of the product unless otherwise specified.
Unless otherwise specified, any statement of optional behavior in this specification prescribed using the terms SHOULD or SHOULD NOT implies product behavior in accordance with the SHOULD or SHOULD NOT prescription. Unless otherwise specified, the term MAY implies that product does not follow the prescription.
No table of changes is available. The document is either new or has had no changes since its last release.